Skip to content

feat: add support for UUID and PG_UUID types across Spanner migration utilities. - #3905

Merged
pratickchokhani merged 3 commits into
GoogleCloudPlatform:mainfrom
pratickchokhani:uuid-target-side
Jul 2, 2026
Merged

feat: add support for UUID and PG_UUID types across Spanner migration utilities.#3905
pratickchokhani merged 3 commits into
GoogleCloudPlatform:mainfrom
pratickchokhani:uuid-target-side

Conversation

@pratickchokhani

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.69%. Comparing base (65d422a) to head (5264417).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
.../v2/spanner/migrations/avro/AvroToValueMapper.java 66.66% 2 Missing ⚠️
...eport/v2/templates/transforms/AssignShardIdFn.java 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3905      +/-   ##
============================================
+ Coverage     55.59%   55.69%   +0.10%     
- Complexity     7052     7196     +144     
============================================
  Files          1103     1117      +14     
  Lines         67681    68340     +659     
  Branches       7603     7702      +99     
============================================
+ Hits          37625    38063     +438     
- Misses        27636    27810     +174     
- Partials       2420     2467      +47     
Components Coverage Δ
spanner-templates 87.80% <84.00%> (-0.69%) ⬇️
spanner-import-export 68.69% <ø> (-0.02%) ⬇️
spanner-live-forward-migration 89.81% <90.47%> (-0.44%) ⬇️
spanner-live-reverse-replication 83.65% <84.00%> (-0.79%) ⬇️
spanner-bulk-migration 92.57% <90.47%> (-0.06%) ⬇️
gcs-spanner-dv 88.85% <90.47%> (-0.06%) ⬇️
Files with missing lines Coverage Δ
...m/google/cloud/teleport/v2/spanner/ddl/Column.java 91.52% <100.00%> (+0.40%) ⬆️
...er/migrations/avro/GenericRecordTypeConvertor.java 96.27% <100.00%> (ø)
...ations/convertors/ChangeEventSpannerConvertor.java 85.24% <ø> (ø)
...igrations/convertors/ChangeEventTypeConvertor.java 88.05% <ø> (ø)
...2/spanner/migrations/spanner/SpannerReadUtils.java 88.15% <ø> (ø)
...om/google/cloud/teleport/v2/spanner/type/Type.java 99.46% <100.00%> (+0.01%) ⬆️
.../v2/spanner/migrations/avro/AvroToValueMapper.java 93.53% <66.66%> (-0.72%) ⬇️
...eport/v2/templates/transforms/AssignShardIdFn.java 83.43% <50.00%> (+0.21%) ⬆️

... and 72 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pratickchokhani
pratickchokhani force-pushed the uuid-target-side branch 12 times, most recently from b2bd219 to 4566208 Compare June 17, 2026 08:58
@pratickchokhani
pratickchokhani force-pushed the uuid-target-side branch 4 times, most recently from 7924f38 to 368d1c1 Compare June 18, 2026 10:47
@pratickchokhani
pratickchokhani marked this pull request as ready for review June 19, 2026 08:07
@pratickchokhani
pratickchokhani requested a review from a team as a code owner June 19, 2026 08:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces first-class support for UUID and PG_UUID data types within the Spanner migration framework. By updating the core type system, mapping logic, and conversion utilities, the changes ensure that UUID fields are correctly identified, mapped, and processed during data migration tasks. These updates improve the robustness of the migration pipeline when dealing with UUID-based schemas.

Highlights

  • UUID Type Support: Added comprehensive support for UUID and PG_UUID types across Spanner migration utilities, including type definitions, mapping logic, and DDL handling.
  • Migration Utilities Updates: Updated Avro-to-Spanner mappers, change event converters, and Spanner read utilities to correctly handle UUID data types.
  • Testing and Validation: Expanded integration tests and schema definitions to validate UUID handling across various migration scenarios, including primary key support and data type conversion.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pratickchokhani
pratickchokhani requested review from aasthabharill and removed request for shreyakhajanchi June 19, 2026 08:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the UUID and PG_UUID data types across several Spanner-related templates and common utilities, including schema parsing, Avro mapping, and change event conversion. A critical compilation issue was identified in AssignShardIdFn.java, where value.getUuid() is called on a Spanner Value object. Since the Spanner Java SDK does not have a getUuid() method, this must be updated to use value.getString() instead.

@aasthabharill aasthabharill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify that gcs-spanner-dv template also incorporates support for Spanner UUID type. I suspect the hashing logic might need some addition

Can you please also add details of any end to end tests you ran in the description

@pull-request-size pull-request-size Bot added size/XL and removed size/L labels Jul 1, 2026
@pratickchokhani
pratickchokhani force-pushed the uuid-target-side branch 4 times, most recently from 086a9e2 to 4fd1a5f Compare July 2, 2026 10:33

@aasthabharill aasthabharill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pratickchokhani
pratickchokhani merged commit 925c463 into GoogleCloudPlatform:main Jul 2, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition New feature or request size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants